/*
 * @Descripttion:
 * @version:
 * @Author: yuanpingfang
 * @Date: 2022-05-28 12:27:45
 * @LastEditors: yuanpingfang
 * @LastEditTime: 2022-06-04 15:26:40
 */
import request from "@/utils/request";

// 查询数据字典列表
export function listEnum(query) {
  return request({
    url: "/ehr/enum/list",
    method: "get",
    params: query,
  });
}

// 查询数据字典详细
export function getEnum(enumTypeId) {
  return request({
    url: "/ehr/enum/" + enumTypeId,
    method: "get",
  });
}

// 新增数据字典
export function addEnum(data) {
  return request({
    url: "/ehr/enum",
    method: "post",
    data: data,
  });
}

// 修改数据字典
export function updateEnum(data) {
  return request({
    url: "/ehr/enum",
    method: "put",
    data: data,
  });
}

// 删除数据字典
export function delEnum(enumTypeId) {
  return request({
    url: "/ehr/enum/" + enumTypeId,
    method: "delete",
  });
}

// 根据enumeration查询字典数据信息
export function getEnumDicts(enumTypeId) {
  return request({
    url: "/ehr/enum/enumeration/" + enumTypeId,
    method: "get",
  });
}

// 获取业务字典选择框列表
export function getEnumTypes() {
  return request({
    url: "/ehr/enum/enumTypes",
    method: "get",
  });
}
export function getAreaData() {
  return request({
    url: "/ehr/enum/area",
    method: "get",
  });
}

// 获取业务字典选择框列表
export function getEntityDicts(entityField) {
  return request({
    url: "/ehr/enum/entity/" + entityField,
    method: "get",
  });
}
// 获取业务字典选择框列表
export function getEntityDictsForSearch(entityField) {
  return request({
      url: "/ehr/enum/entity/search/" + entityField,
      method: "get",
  });
}
// 获取用户字典选择框列表
export function getUserEnum() {
  return request({
      url: '/ehr/enum/userEnum/',
      method: 'get'
  });
}
